<!DOCTYPE html>
<html>
<head>
	<title></title>

</head>

<body>
<div id="container">
    <H1 class="title"><A href="javascript:void(0)">(1)这里放标题</H1>
    <div class="content">
        <p>(1)这里放内容</p>
    </div>
    <H1 class="title"><A href="javascript:void(0)">(2)这里放标题</H1>
    <div class="content">
        <p>(2)这里放内容</p>
    </div><H1 class="title"><A href="javascript:void(0)">(3)这里放标题</H1>
    <div class="content">
        <p>(3)这里放内容</p>
    </div>
</div>
</body>
<script src="../js/moofx/prototype.lite.js" type="text/javascript"></script>
<script src="../js/moofx/moo.fx.js" type="text/javascript"></script>
<script src="../js/moofx/moo.fx.pack.js" type="text/javascript"></script>
<script type="text/javascript">
    //定义contents 组数为所有将要显示的内容
    var contents = document.getElementsByClassName('content');
    //定义contents 组数为所有标题，也是可点击展开的按钮
    var toggles = document.getElementsByClassName('title');

    //调用moofx JS库
    var myAccordion = new fx.Accordion(
        toggles, contents, {opacity: true, duration: 400}   //opacity确定是否有alpha透明变化,duration确定动作所有时间
    );
    myAccordion.showThisHideOpen(contents[0]);  //默认打开第一个内容
</script>


</html>